Options:
-h, --help Print this message
--vcs VCS Initialize a new repository for the given version
- control system (git or hg) or do not initialize any version
+ control system (git, hg, or pijul) or do not initialize any version
control at all (none) overriding a global configuration.
--bin Use a binary (application) template
--lib Use a library template
use term::color::BLACK;
use core::Workspace;
-use util::{GitRepo, HgRepo, CargoResult, human, ChainError, internal};
+use util::{GitRepo, HgRepo, PijulRepo, CargoResult, human, ChainError, internal};
use util::{Config, paths};
use toml;
#[derive(Clone, Copy, Debug, PartialEq)]
-pub enum VersionControl { Git, Hg, NoVcs }
+pub enum VersionControl { Git, Hg, Pijul, NoVcs }
pub struct NewOptions<'a> {
pub version_control: Option<VersionControl>,
Ok(match &d.read_str()?[..] {
"git" => VersionControl::Git,
"hg" => VersionControl::Hg,
+ "pijul" => VersionControl::Pijul,
"none" => VersionControl::NoVcs,
n => {
let err = format!("could not decode '{}' as version control", n);
num_detected_vsces += 1;
}
+ if fs::metadata(&path.join(".pijul")).is_ok() {
+ version_control = Some(VersionControl::Pijul);
+ num_detected_vsces += 1;
+ }
+
// if none exists, maybe create git, like in `cargo new`
if num_detected_vsces > 1 {
- bail!("both .git and .hg directories found \
+ bail!("more than one of .hg, .git, or .pijul directories found \
and the ignore file can't be \
filled in as a result, \
specify --vcs to override detection");
}
paths::append(&path.join(".hgignore"), ignore.as_bytes())?;
},
+ VersionControl::Pijul => {
+ if !fs::metadata(&path.join(".pijul")).is_ok() {
+ PijulRepo::init(path, config.cwd())?;
+ }
+ },
VersionControl::NoVcs => {
fs::create_dir_all(path)?;
},